package model;

import java.util.ArrayList;

public class Guest {
	private int id;
	private String fname;
	private String lname;
	private String address;
	private String country;
	private String phone;
	private String email;
	private String travelAgency;
		private ArrayList<RoomReservation> rReservation;
	
	public Guest(){}
	public Guest(int id)
	{
		this.id = id;
	}
	

	public String getFname() {
		return fname;
	}

	public void setFname(String fname) {
		this.fname = fname;
	}

	public String getLname() {
		return lname;
	}

	public void setLname(String lname) {
		this.lname = lname;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public ArrayList<RoomReservation> getrReservations() {
		return rReservation;
	}

	public void setrReservations(ArrayList<RoomReservation> rReservation) {
		this.rReservation = rReservation;
	}
	
	public void addRoomReservation(RoomReservation rRes)
	{
		rReservation.add(rRes);
	}
	
	public void deleterReservation(int rrId)
	{
		boolean found = false;
		for(int i = 0; i<rReservation.size() && !found; i++)
		{
			RoomReservation rr = rReservation.get(i);
			if(rrId == rr.getId())
			{
				rReservation.remove(rr);
				found = true;
			}
		}
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getTravelAgency() {
		return travelAgency;
	}

	public void setTravelAgency(String travelAgency) {
		this.travelAgency = travelAgency;
	}
	
	@Override
	public String toString()
	{
		return "id: " + id +" First Name: " + fname +" Last Name: " + lname + " Address: " 
	+ address + "Country: " + country + "phone: " + phone + "Email: " + email + "Travel Agency: " + travelAgency;	}
	
}

